import { useState, useEffect } from "react";

const Chapter7 = (props) => {
    const { title } = props;
    const [count, setCount] = useState(0);
    useEffect(() => {
        console.log("useEffect副作用函数执行");
    }, [count]);
    return (
        <div className='wrapper wrapper7'>
            <div className='page-header'>
                <h3>{title}</h3>
            </div>
            <div className='page-content'>
                <div className='alert alert-danger'>当前数值为：{count}</div>
                <button
                    className='btn btn-default'
                    onClick={() => setCount(count + 3)}
                >
                    count增加
                </button>
            </div>
        </div>
    );
};

export default Chapter7;
